import SDKManager from "../SDKManager";

const { ccclass, property } = cc._decorator;

@ccclass
export default class InsertAdComp extends cc.Component {

    static enterCount: number = 0;

    @property
    adSite: number = 0;

    // LIFE-CYCLE CALLBACKS:

    onLoad() {
        let flag = SDKManager.getChannel().hasInsertAd()


        if (flag) {
            console.log(' InsertAdComp.enterCount ', InsertAdComp.enterCount)
            // if (InsertAdComp.enterCount++ % 2 == 0) {
            // if (SDKManager.getChannel().isInsertOpen())
            // SDKManager.getChannel().showInsertAd(this.adSite)
            // }
        } else {

        }


    }



    onDestroy() {
        if (SDKManager.getChannel().hasInsertAd()) {
            // if (SDKManager.getChannel().isInsertOpen())
            //     SDKManager.getChannel().closeInsertAd()
        }
    }
}

